package com.luoyi.service;


import cn.hutool.core.util.StrUtil;
import cn.hutool.poi.excel.ExcelUtil;
import cn.hutool.poi.excel.ExcelWriter;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.luoyi.param.ExportYapiTableToWordParam;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.stream.Collectors;

@Service
public interface TestService {


    static String json = "[\n" +
            "\n" +
            "\n" +
            "{\"prop\":\"guid\",\"label\":\"GUID\",\"width\":120},\n" +
            "{\"prop\":\"pernr\",\"label\":\"员工工号\",\"width\":120},\n" +
            "{\"prop\":\"eName\",\"label\":\"员工姓名\",\"width\":120},\n" +
            "\n" +
            "\n" +
            "\n" +
            "{\"prop\":\"unit\",\"label\":\"所属单元\",\"width\":120},\n" +
            "{\"prop\":\"dept\",\"label\":\"所属部门\",\"width\":120},\n" +
            "{\"prop\":\"position\",\"label\":\"岗位\",\"width\":120},\n" +
            "{\"prop\":\"positionType\",\"label\":\"职位类别\",\"width\":120},\n" +
            "\n" +
            "\n" +
            "{\"prop\":\"phoneNum\",\"label\":\"手机号\"},\n" +
            "\n" +
            "\n" +
            "{\"prop\":\"question1\",\"label\":\"1. 您的入职办理时长是？\",\"width\":280},\n" +
            "{\"prop\":\"question2\",\"label\":\"2. 办理人员是否使用规范用语？\",\"width\":280},\n" +
            "{\"prop\":\"question3\",\"label\":\"3. 针对您的入职资料，办理人员会_____？\",\"width\":280},\n" +
            "{\"prop\":\"question4\",\"label\":\"4. 办理入职过程中（包含但不限于劳动合同签订等内容），办理人员对您提出的疑问能_____？\",\"width\":280},\n" +
            "{\"prop\":\"question5\",\"label\":\"5. 您认为入职办理过程中待提升的地方是_____？\",\"width\":280},\n" +
            "{\"prop\":\"question6\",\"label\":\"6. 请您对本次入职办理的服务进行综合评价？\",\"width\":280},\n" +
            "\n" +
            "\n" +
            "\n" +
            "{\"prop\":\"createdBy\",\"label\":\"处理人工号\",\"width\":120},\n" +
            "{\"prop\":\"createdName\",\"label\":\"处理人姓名\",\"width\":120},\n" +
            "\n" +
            "{\"prop\":\"statusText\",\"label\":\"状态\"},\n" +
            "\n" +
            "\n" +
            "\n" +
            "\n" +
            "]";



    public static void main(String[] args) {

        // 设置excel列宽



        JSONArray objects = JSON.parseArray(json);
        for (int i = 0; i < objects.size(); i++) {
            JSONObject jsonObject = objects.getJSONObject(i);
            String prop = jsonObject.getString("prop");
            String label = jsonObject.getString("label");
            String width = jsonObject.getString("width");
            System.out.println(StrUtil.format("{}(\"{}\", \"{}\", {}),", prop.toUpperCase(Locale.ROOT), prop, label, width));
        }
    }

}
